<html><head>
        <link href="<?php echo base_url('assets/css/formpenduduk.css'); ?>" rel="stylesheet" type="text/css">
        <title>Laporan Data Penduduk</title>
    </head>
    <body>
        <table width="100%" border="0" align="center">
            <tr>
                <td colspan="13" class="trheader">Laporan Data Penduduk</td>
            </tr>
            
            <tr>
                <td colspan="13" class="jeda">&nbsp;</td>
            </tr>
            <tr>
                <td width="2%" bordercolor="#666666"><div align="center"><strong>No.</strong></div></td>
                <td width="8%" bordercolor="#666666"><div align="center"><strong>NIK</strong></div></td>
              <td width="11%" bordercolor="#666666"><div align="center"><strong>No KK</strong></div></td>
              <td width="9%" bordercolor="#666666"><div align="center"><strong>Nama</strong></div></td>
              <td width="10%" bordercolor="#666666"><div align="center"><strong>Tempat Lahir</strong></div></td>
              <td width="11%" bordercolor="#666666"><div align="center"><strong>Tgl Lahir</strong></div></td>
              <td width="8%" bordercolor="#666666"><div align="center"><strong>Umur</strong></div></td>
                <td width="5%" bordercolor="#666666"><div align="center"><strong>Jen. Kelamin</strong></div></td>
                <td width="10%" bordercolor="#666666"><div align="center"><strong>Status Dlm Keluarga</strong></div></td>
                <td width="12%" bordercolor="#666666"><div align="center"><strong>Alamat</strong></div></td>
              <td width="4%" bordercolor="#666666"><div align="center"><strong>Status </strong></div></td>
              <td width="10%" colspan="2" bordercolor="#666666"><div align="center"><strong>Atur<br>Ubah - Hapus</strong></div></td>
            </tr>

            <?php
            if (isset($penduduk)) {
                $no = 1;
                foreach ($penduduk->result() as $data_penduduk) {
                    echo '<tr>';
                    echo '<td><div align="center">' . $no++ . '</div></td>';
                    echo '<td>' . $data_penduduk->nik . '</td>';
                    echo '<td>' . $data_penduduk->no_kk . '</td>';
                    echo '<td>' . $data_penduduk->nama . '</td>';
                    echo '<td>' . $data_penduduk->tempat_lahir . '</td>';
                    echo '<td>' . $this->tanggal->tanggal_indonesia($data_penduduk->tanggal_lahir) . '</td>';
                    echo '<td>' . $this->umur->hitung_umur($data_penduduk->tanggal_lahir, date('Y-m-d')) . '</td>';
                    echo '<td><div align="center">' . $data_penduduk->jenis_kelamin . '</div></td>';
                    echo '<td>' . $data_penduduk->statuskeluarga . '</td>';
                    echo '<td> Dusun ' . $data_penduduk->dusun . '<br>RT ' . $data_penduduk->rt . ' RW ' . $data_penduduk->rw . '</td>';
                    echo '<td><div align="center">'; echo $data_penduduk->status?'Aktif':'Tidak aktif'; echo '</div></td>';
                    echo '<td><div align="center"><a href="' . base_url('penduduk/ubah/' . $data_penduduk->nik) . '"><img src="' . base_url('assets/images/ubah.png') . '"></a>  -  <a href="' . base_url('penduduk/hapus/' . $data_penduduk->nik) . '"><img src="' . base_url('assets/images/hapus.png') . '"></a></div></td>';
                    echo '</tr>';
                }
            }
            ?>
        </table>
        <br>
        <table width="289" border="0" align="center">
            <tr>
                <td colspan="2" class="jeda">Data Tercatat</td>
            </tr>
            <tr>
                <td width="110">Jumlah Penduduk</td>
                <td width="169">: <?php echo $penduduk->num_rows(); ?> jiwa</td>
            </tr>
           
        </table>

    </body>
</html>
